<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.joinhawaii.admin.sales.*" %>
<%

	HashList code007	= CommonUtil.getCodeList("007");	//호텔구분
	HashList code100	= CommonUtil.getCodeList("100");	//여행구분
	HashList code118	= CommonUtil.getCodeList("118");	//여행인원
	HashList code120	= CommonUtil.getCodeList("120");	//견적의뢰상태


	String job_type			= StringUtil.nvl(request.getParameter("job_type"), "U");
	String req_id			= StringUtil.nvl(request.getParameter("req_id"));



	HashMap infos = new HashMap();
	infos.put("req_id",	req_id);


	SalesDAO dao 			= new SalesDAO();
	HashList list 			= dao.selectReqInfo(infos);		//바로예야
	HashList hotelList 		= dao.selectReqHotelList(infos);	//
	HashList customerList 	= dao.selectReqCustomerList(infos);	//
	HashList enjoyList 		= dao.selectReqEnjoyList(infos);	//
	HashList carList 		= dao.selectReqCarList(infos);	//




%>

				<form id="saveForm" method="post" action="">
				<input type="hidden" name="job_type" id="job_type" value="<%= job_type %>"/>
				<input type="hidden" name="req_id" value="<%= list.get("req_id", 0) %>"/>
				<input type="hidden" name="req_gubn" value="2"/>


				<table cellpadding="0" cellspacing="0" class="table_01 mt10">
				<colgroup>
					<col width="100px"/>
					<col width="305px"/>
					<col width="100px"/>
					<col/>
				</colgroup>
				<tbody>
					<!-- 기본정보 -->
					<tr>
						<th><p>전체일정</p></th>
						<td>
							<input type="text" name="start_dt" class="w100 c" value="<%= StringUtil.toDate(list.get("start_dt", 0),".") %>"  />
							~
							<input type="text" name="end_dt" class="w100 c" value="<%= StringUtil.toDate(list.get("end_dt", 0),".") %>"  />
						</td>
						<th><p>국제선</p></th>
						<td class="brx">
							<input type="text" name="start_air_name" class="w160" value="<%= list.get("start_air_name", 0) %>"  />
							<input type="text" name="return_air_name" class="w160" value="<%= list.get("return_air_name", 0) %>"  />
						</td>
					</tr>
					<tr>
						<th><p>숙박호텔</p></th>
						<td colspan="3" class="brx">
					<%	if (hotelList.size() > 0) { %>
							<table cellpadding="0" cellspacing="0" class="table_04">
							<colgroup>
								<col width="300px"/>
								<col width="300px"/>
							</colgroup>
							<tbody>
								<tr>
									<th><p>호텔명</p></th>
									<th><p>숙박기간</p></th>
								</tr>
							<%	for (int i = 0; i < hotelList.size(); i++) { %>
								<tr>
									<td><%= hotelList.get("hotel_name", i) %></td>
									<td class="c">
										<%= StringUtil.toDate(hotelList.get("start_dt",i)) %>
										~
										<%= StringUtil.toDate(hotelList.get("end_dt",i)) %>
									</td>
								</tr>
							<%	} %>


							</tbody>
							</table>
					<%	} %>

						</td>
					</tr>
					<tr>
						<th><p>여행자정보</p></th>
						<td colspan="3" class="brx">
					<%	if (customerList.size() > 0) { %>
							<table cellpadding="0" cellspacing="0" class="table_04">
							<colgroup>
								<col width="100px"/>
								<col width="200px"/>
								<col width="150px"/>
								<col width="150px"/>
							</colgroup>
							<tbody>
								<tr>
									<th><p>성함</p></th>
									<th><p>영문성함</p></th>
									<th><p>생년월일</p></th>
									<th><p>성별</p></th>
								</tr>
							<%	for (int i = 0; i < customerList.size(); i++) { %>
								<tr>
									<td><%= customerList.get("customer_name", i) %></td>
									<td><%= customerList.get("customer_eng_name", i) %></td>
									<td><%= StringUtil.toDate(customerList.get("birth_date", i),".") %></td>
									<td><%= customerList.get("gender", i) %></td>
								</tr>
							<%	} %>


							</tbody>
							</table>
					<%	} %>

						</td>
					</tr>


					<tr>
						<th><p>선택관광</p></th>
						<td colspan="3" class="brx">
					<%	if (enjoyList.size() > 0) { %>
							<table cellpadding="0" cellspacing="0" class="table_04">
							<colgroup>
								<col width="100px"/>
								<col width="200px"/>
								<col width="150px"/>
								<col width="50px"/>
								<col width="50px"/>
								<col width="50px"/>
							</colgroup>
							<tbody>
								<tr>
									<th><p>진행일</p></th>
									<th><p>상품명</p></th>
									<th><p>종류</p></th>
									<th><p>성인</p></th>
									<th><p>소아</p></th>
									<th><p>유아</p></th>
								</tr>
							<%	for (int i = 0; i < enjoyList.size(); i++) { %>
								<tr>
									<td class="c"><%= StringUtil.toDate(enjoyList.get("start_dt",i)) %></td>
									<td><%= enjoyList.get("enjoy_name", i) %></td>
									<td><%= enjoyList.get("price_name", i) %></td>
									<td>
									<%	if (!"0".equals(enjoyList.get("adult_count",i))) { %>
											<%= enjoyList.get("adult_count",i) %>명
									<%	} %>
									</td>
									<td>
									<%	if (!"0".equals(enjoyList.get("child_count",i))) { %>
										<%= enjoyList.get("child_count",i) %>명
									<%	} %>
									</td>
									<td>
									<%	if (!"0".equals(enjoyList.get("baby_count",i))) { %>
										<%= enjoyList.get("baby_count",i) %>명
									<%	} %>
									</td>
								</tr>
							<%	} %>


							</tbody>
							</table>
					<%	} %>
						</td>
					</tr>
					<tr>
						<th><p>렌터카</p></th>
						<td colspan="3" class="brx">
					<%	if (carList.size() > 0) { %>
							<table cellpadding="0" cellspacing="0" class="table_04">
							<colgroup>
								<col width="300px"/>
								<col width="150px"/>
								<col width="150px"/>
							</colgroup>
							<tbody>
								<tr>
									<th><p>차종</p></th>
									<th><p>대여일자</p></th>
									<th><p>사용일수</p></th>
								</tr>
							<%	for (int i = 0; i < carList.size(); i++) { %>
								<tr>
									<td><%= carList.get("car_name", i) %></td>
									<td class="c"><%= StringUtil.toDate(carList.get("start_dt",i)) %></td>
									<td><%= carList.get("rent_day",i) %>일</td>
								</tr>
							<%	} %>


							</tbody>
							</table>
					<%	} %>
						</td>
					</tr>
					<tr>
						<th><p>작성자</p></th>
						<td>
							<input type="text" name="customer_name" class="w200" value="<%= list.get("customer_name", 0) %>"  />
						</td>
						<th><p>이메일</p></th>
						<td class="brx">
							<input type="text" name="email_addr" class="w200" value="<%= list.get("email_addr", 0) %>"  />
						</td>
					</tr>
					<tr>
						<th><p>연락처</p></th>
						<td>
							<input type="text" name="phone_no" class="w200" value="<%= list.get("phone_no", 0) %>"  />
						</td>
						<th><p>비밀번호</p></th>
						<td class="brx">
							<input type="text" name="password" class="w200" value="<%= list.get("password", 0) %>"  />
						</td>
					</tr>
					<tr>
						<th><p>문의사항</p></th>
						<td colspan="3" class="brx">
							<textarea name="req_info" id="req_info" style="width:860px; height:120px"><%= list.get("req_info", 0) %></textarea>
						</td>
					</tr>
					<tr>
						<th><p>처리결과</p></th>
						<td>
							<select name="req_status" class="w120">
							<%= StringUtil.makeOption(code120, list.get("req_status", 0)) %>
						  	</select>
						</td>
						<th><p>처리일자</p></th>
						<td class="brx">
							<%= list.get("req_date", 0) %>
						</td>
					</tr>
					<tr>
						<th><p>진행사항</p></th>
						<td colspan="3" class="brx">
							<textarea name="res_info" id="res_info" style="width:860px; height:120px"><%= list.get("res_info", 0) %></textarea>
						</td>
					</tr>
				</tbody>
				</table>



				</form>

